package pt.nmfa.peste.session;

import pt.nmfa.peste.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("actionParametersList")
public class ActionParametersList extends EntityQuery<ActionParameters> {

	private static final String EJBQL = "select actionParameters from ActionParameters actionParameters";

	private static final String[] RESTRICTIONS = {
			"lower(actionParameters.parameterName) like lower(concat(#{actionParametersList.actionParameters.parameterName},'%'))",
			"lower(actionParameters.parameterValue) like lower(concat(#{actionParametersList.actionParameters.parameterValue},'%'))", };

	private ActionParameters actionParameters = new ActionParameters();

	public ActionParametersList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public ActionParameters getActionParameters() {
		return actionParameters;
	}
}
